#include "ScnsGyro.c.h"

#if defined(SCNS_GYRO_ENABLE)&&SCNS_GYRO_ENABLE==1

#include "ScnsMenu.h"
#include "ScnsSmctpExtOscilloscope.h"
#include "ScnsIcm20602.h"
#include "ScnsIcm42605.h"

ScnsStatus scnsBspGyroPostInit(ScnsGyroEnum gyrN)
{
    scnsMenuSetPage(4,"gyro",NULL);
    scnsMenuAddConstStruct(4,scnsGyroResult[SCNS_GYRO_1],pitch,,SCNS_TYPE_FLOAT);
    scnsMenuAddConstStruct(4,scnsGyroResult[SCNS_GYRO_1],roll,,SCNS_TYPE_FLOAT);
    scnsMenuAddConstStruct(4,scnsGyroResult[SCNS_GYRO_1],yaw,,SCNS_TYPE_FLOAT);
    scnsMenuAddConstStruct(4,scnsGyroResult[SCNS_GYRO_1],temp,,SCNS_TYPE_FLOAT);
    return SCNS_STATUS_OK;
}
void scnsBspGyroResultUpdate(ScnsGyroEnum gyrN)
{
#if defined(SCNS_SMCTP_EXT_OSCILLOSCOPE_ENABLE)&&SCNS_SMCTP_EXT_OSCILLOSCOPE_ENABLE==1
    ScnsGyroResult this=scnsGyroResult[gyrN];
    if(scnsMenuCanPageSend(4))
        scnsSmctpExtOscilloscopeSend(
            SCNS_SMCTP_CHANNEL_VISUAL_SCOPE,
            this.pitch,
            this.roll,
            this.yaw,

            this.dPitch,
            this.oDPitch,

            this.dRoll,
            this.oDRoll,

            this.dYaw,
            this.oDYaw,

            this.oAx,
            this.oAy,
            this.oAz,

            this.ax,
            this.ay,
            this.az,

            this.pAx,
            this.pAy,
            this.pAz,
        );
#endif
}

void scnsBspGyroCalibrationBackup(ScnsGyroEnum gyrN,const ScnsGyroSourceCalibration*ca)
{
    hxPrintfFL("Backup gyroBiasX:%f,gyroBiasY:%f,gyroBiasZ:%f,zeroA:%f\n",ca->gyroBiasX,ca->gyroBiasY,ca->gyroBiasZ,ca->zeroA);
}

#endif
